import {reqAddressInfo,reqOrderInfo} from "../api";
const state={
  address:[],
  orderInfo: []
}
const mutations={
  GETUSERADDRESS(state, userInfo) {
        state.address=userInfo.data||[]
  },
  GETORDERINFO(state,orderInfo){
    state.orderInfo=orderInfo.data
  }
}
const actions={
  async getUserAddress({commit}){
    let result=await reqAddressInfo()
    console.log(result)
    commit('GETUSERADDRESS',result.data)
  },
  async getOrderInfo({commit}){
    let result=await reqOrderInfo()
    console.log(result)
    commit('GETORDERINFO',result.data)
  }
}
const getters={}
export default {
  state,
  mutations,
  actions,
  getters
}
